package com.local.videoplayer.activity;

import android.animation.Animator;
import android.animation.ObjectAnimator;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.widget.ImageView;
import com.local.videoplayer.R;

/**
 * Created by ccx on 17/3/30.
 */

public class SplashActivity extends BaseActivity
{
	private ObjectAnimator mAnimator;
	private static final int DELAY_TIME = 1500;
	private ImageView mIvLogo;

	@Override
	protected void onCreate(@Nullable Bundle savedInstanceState)
	{
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activiy_splash);
		initView();
		mAnimator = ObjectAnimator.ofFloat(mIvLogo, "alpha", 0, 1f);
		mAnimator.setDuration(DELAY_TIME);
		mAnimator.addListener(new Animator.AnimatorListener()
		{
			@Override
			public void onAnimationStart(Animator animation)
			{

			}

			@Override
			public void onAnimationEnd(Animator animation)
			{
				goToOthersF(MainActivity.class);
			}

			@Override
			public void onAnimationCancel(Animator animation)
			{

			}

			@Override
			public void onAnimationRepeat(Animator animation)
			{

			}
		});
		mAnimator.start();

	}

	private void initView()
	{
		mIvLogo = (ImageView) findViewById(R.id.iv_logo);
	}
}
